package cc.vicp.djx314.starfood.web;

import java.sql.Time;
import java.util.Date;

import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.context.request.WebRequest;

import cc.vicp.djx314.starfood.util.time.DateEditor;
import cc.vicp.djx314.starfood.util.time.SqlTimeEditor;

public class StarfoodBindingInitializer implements WebBindingInitializer {
	@Override
	public void initBinder(WebDataBinder binder, WebRequest request) {
		//SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
		binder.registerCustomEditor(Date.class, new DateEditor());
		binder.registerCustomEditor(Time.class, new SqlTimeEditor());
	}
}